package com.example.web;

import com.example.vo.Result;
import org.dozer.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

@RestController
public class BaseController {

    @Autowired
    protected Mapper mapper;

    protected Mono<Result> resultMono(Result result) {
        return Mono.just(result).onErrorReturn(Result.error());
    }

    protected Flux<Result> resultFlux(Result result) {
        return Flux.just(result).onErrorReturn(Result.error());
    }
}
